﻿//using System.Collections.Generic;
//using System.Linq;
//using Authorization;
//using Bussiness;
//using Bussiness.Mangement;
//using Entity;
//using Microsoft.AspNetCore.Http;
//using Microsoft.AspNetCore.Mvc;
//using Commons;
//using Microsoft.AspNetCore.Authorization;
//using Microsoft.AspNetCore.Hosting;
//using System.IO;
//using Entity.Project;
//using Bussiness.Mangement.Project;
//using System.Threading.Tasks;

//namespace NetCoreAPI.Controllers.Portal
//{
//    /// <summary>
//    /// 对局记录
//    /// </summary>
//    [CheckLogin]
//    [ApiController]
//    public class GameRecordController : PortalApiController
//    {

//        /// <summary>
//        /// 根据key获取同一局游戏信息
//        /// </summary>
//        /// <param name="key"></param>
//        /// <returns></returns>
//        [HttpGet]
//        [AllowAnonymous]
//        public async Task<JsonResult> GetGameRecordByKey(string key)
//        {
//            try
//            {
//                var total = 0;
//                List<GameRecord> list;
//                var userS = ServiceHelp.GetUserService;
//                await Task.FromResult(list=GameRecordBussiness.Init.GetPageList(new GameRecord() { RecordKey = key }, 1, 10,ref total));
//                var result = from item in list
//                             select new
//                             {
//                                 item.CommunityCards,item.RecordKey,item.RoomKey,item.Id,item.isFold,item.IsWin,item.Jetton,item.PlayerCards,item.Wands,item.UserId,
//                                 StartTime=item.StartTime.ToLongString(),
//                                 EndTime=item.EndTime.ToLongString(),
//                                 User=userS.GetById(item.UserId)
//                             };
//                return new JsonResult(HttpResult.Success(result));
//            }
//            catch (System.Exception ex)
//            {
//                return new JsonResult(HttpResult.Success(HttpResultCode.SelectFail, "未获取到用户信息。", ex.Message));
//            }

//        }
//    }
//}
